package com.foomia.truegoed.maps;

import android.content.Context;
import android.graphics.Canvas;
import android.util.Log;

import com.foomia.truegoed.TruegoedSettings;
import com.foomia.truegoed.util.DumpcatcherHelper;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;

public class CrashFixMyLocationOverlay  extends MyLocationOverlay{
	static final String TAG = "CrashFixMyLocationOverlay";
    static final boolean DEBUG = TruegoedSettings.DEBUG;

    public CrashFixMyLocationOverlay(Context context, MapView mapView) {
        super(context, mapView);
    }

    @Override
    public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {
        try {
            return super.draw(canvas, mapView, shadow, when);
        } catch (ClassCastException e) {
            if (DEBUG) Log.d(TAG, "Encountered overlay crash bug", e);
            DumpcatcherHelper.sendException(e);
            return false;
        }
    }

}
